<%--
  Created by IntelliJ IDEA.
  User: 邱华英
  Date: 2022/10/2
  Time: 19:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import="java.util.List" %>
<%@ page import="java.util.Map" %>
<html>
<head>
    <title>用户收藏</title>
    <style type="text/css">
        /*table,td,tr,th{*/
        /*    border: 1px solid  black;*/
        /*    text-align: center;*/
        /*    border-collapse: collapse;*/
        /*    height: 55px;*/
        /*}*/
        /*table{*/
        /*    width: 90%;*/
        /*}*/
        .fengye{
          border: 1px solid;
          display: inline;
          padding: 8px 16px;
        }

        span{
          color: aliceblue;
        }
        /*table{*/

        /*  width: 980px;*/
        /*}*/


        /*td{*/

        /*  overflow: hidden;*/

        /*}*/

        table{

          width: 980px;
          height: 350px;
          font-size: 15px;

        }
        th{
          white-space: nowrap;
        }

        img{
          width: 100%;
          height: 100%;
        }

        #ab{
          width: 50%;
        }
        #fff{
          float: left;
          margin-left: 50px;
          width:693px;
          height: 44px;
          border: 1px solid black;
          position: relative;
        }

        #sss {
          float: left;
          height: 41px;
          width: 100px;
          text-align: center;
        }

        #ttt {
          float: left;
          width: 510px;
          height: 41px;
          padding-left: 10px;
          line-height: 41px;
        }

        #iii {
          /* float: right; */
          position: absolute;
          top: 0;
          left: 611px;
          width: 80px;
          height: 41px;
          background-color: #2d241d;
          font-size: 16px;
          color: #fff;
        }
        .tupian {
          width: 100px;
          height: 65px;
        }
        tr{
          height: 50px;
        }
        /*img{*/
        /*  width: 100%;*/
        /*  height: 100%;*/
        /*}*/
        /*th{*/
        /*  white-space: nowrap;*/
        /*}*/
    </style>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="/css/base.css">
  <link rel="stylesheet" href="/css/common.css">
  <link rel="stylesheet" href="/css/index.css">
  <link rel="stylesheet" href="/css/booksearch.css">
  <link rel="stylesheet" href="/css/readeradmin.css">
  <title>图书馆</title>
</head>

<body>
<%
  String contextPath = request.getSession().getServletContext().getContextPath();
%>
<section class="shortcut">
  <div class="w">
    <div class="fl">
      <ul>
        <li>图书管理系统！&nbsp;</li>
        <li>
          <a href="<%=contextPath%>/user/">退出</a>
          <a href="#" class="style-red">请登录</a>
        </li>
      </ul>
    </div>
    <div class="fr">
      <ul>


        <li class="arrow-icon"><a href="aindex.html">联系管理员</a> </li>
        <li>|</li>
        <li class="arrow-icon"> <a href="login.html">关于图书馆</a></li>
      </ul>
    </div>
  </div>
</section>
<header class="header w">
  <!-- logo -->
  <div class="logo">
    <h1>
      <a href="index.html" title="图书管理系统">人类进步的阶梯</a>
    </h1>
  </div>



</header>
<nav class="nav">
  <div class="w">

    <div class="dropdown">
      <div class="dt"> <a href="index.html">首页</a> </div>
      <div class="dd">
        <ul>
          <li><a href="<%=contextPath%>/user/library/">图书馆</a> </li>

          <li><a href="<%=contextPath%>/user/collect/">我的收藏</a> </li>
          <li><a href="<%=contextPath%>/user/borrow/">我的借阅</a> </li>
          <li><a href="<%=contextPath%>/user/personCenter/">我的信息</a> </li>
          <li><a href="<%=contextPath%>/user/inform/all/">通知</a> </li>

        </ul>
      </div>
    </div>
    <form  id="fff"   action="<%=contextPath%>/user/collect/select" method="post" onsubmit="return testEmpty()">
      <select id="sss"    name="select">
        <option value="bookName">书名</option>
        <option value="author">作者</option>
      </select>
      <input  id="ttt"   type="text" name="text"/>
      <input id="iii"    type="submit" value="搜索"/><br><br>
    </form>
  </div>
</nav>
<div class="w">
  <div class="main">
    <table  id="mainTable" align="center " id="mainTable" border="1px" cellpadding="0" cellspacing="0" width="980px "  ;>
      <thead class="biaoge ">
      <tr>
        <th>编号</th>
        <th>图片</th>
        <th>类型</th>
        <th width=13%>书名</th>
        <th width=13%>作者</th>
        <th>简介</th>
        <th>总量</th>
        <th>余量</th>
        <th>操作1</th> <!-- //借书，还书<a></a> -->

      </tr>
      </thead>


<%--<%--%>
<%--    String contextPath = request.getSession().getServletContext().getContextPath();--%>
<%--  %>--%>
<%--  <a href="<%=contextPath%>/user/">退出</a><br>--%>
<%--    <form action="<%=contextPath%>/user/collect/select" method="post">--%>
<%--      <select name="select">--%>
<%--        <option value="bookName">书名</option>--%>
<%--        <option value="author">作者</option>--%>
<%--      </select>--%>
<%--      <input type="text" name="text"/>--%>
<%--      <input type="submit" value="搜索"/><br><br>--%>
<%--    </form><br>--%>
<%--    <div>--%>
<%--      <table border="1px">--%>
<%--        <th>图书编号</th>--%>
<%--        <th>图片</th>--%>
<%--        <th>书本类型</th>--%>
<%--        <th>书名</th>--%>
<%--        <th>作者</th>--%>
<%--        <th>简介</th>--%>
<%--        <th>总量</th>--%>
<%--        <th>余量</th>--%>
<%--        <th>操作1</th> <!-- //借书，还书<a></a> -->--%>
        <%
          List<Map<String, Object>> books = (List<Map<String, Object>>) request.getAttribute("books");

          if(books != null){
            for(int i = 0;i < books.size();i++){
              Map<String, Object> b = books.get(i);

        %>
        <tr>
          <td name="bookid"><%=b.get("id")%></td>
          <td><div class="tupian"><img src="/image/<%=b.get("photo")%>"></div></td>
          <td><%=b.get("type")%></td>
          <td><%=b.get("bName")%></td>
          <td><%=b.get("bAuthor")%></td>
          <td><%=b.get("bIntroduction")%></td>
          <td><%=b.get("account")%></td>
          <td><%=b.get("yuliang")%></td>
          <td><a href="<%=contextPath%>/user/collect/delete?bookid=<%=b.get("id")%>">删除</a></td>
        </tr>
        <%}%>
        <%}%>
      </table><br><br>
    <div>
        <li class="fengye"><a onclick="deleteYeshu()"><<</a></li>
        <li class="fengye">第<label name="yeshu" id="yeshu">${yeshu}</label>页</li>
        <li class="fengye"><a onclick="addYeshu()">>></a></li>
    </div>

  </div>
</div>
<div class="w">
  <div class="minyan">

    六经三史，诸子百家，非无可观，皆是为治。
  </div>
</div>
</body>

<script type="text/javascript">
    function addYeshu(){
        var yeshu1 = document.getElementById("yeshu");
        window.location.href="<%=contextPath%>/user/collect/search/add?yeshu="+yeshu1.innerText;
    }
    function deleteYeshu(){
        var yeshu1 = document.getElementById("yeshu");
        window.location.href="<%=contextPath%>/user/collect/search/delete?yeshu="+yeshu1.innerText;
    }
</script>
</html>
